home *** CD-ROM | disk | FTP | other *** search
/ PC Format 25 / PCFormat 1993-10.iso / UTILS.ZIP / EXISTDIR.TXT < prev    next >
Text File  |  1992-05-20  |  3KB  |  56 lines

  1. EXISTDIR: check existence of some "name" as a file or subdirectory.
  2. By Jim Groeneveld, Netherlands, 20/5-92.
  3.  
  4. Package EXISTDIR contains the following files:
  5.  
  6. CHKEX    BAT      541   3-22-91          Initial version, using 'pathname\NUL'
  7. CHKEXIST BAT      543   3-22-91          Similar version, differently written
  8. CHKEXNET BAT      853   5-20-92   1:00a  Improved version, also for networks
  9. CHKXPATH BAT     1067   5-20-92   1:00a  Similar version, creates check files
  10. CHKXPATH COM     2177   5-20-92   1:00a  Compiled version of above
  11. CHKEXDRV BAT      195   5-20-92   1:00a  Application checks existence of drives
  12. EXISTDIR TXT     3205   5-20-92   1:00a  This accompanying describing text file
  13.  
  14. Both initial versions (22/3-91) work all right on standalone PC's.
  15. They check existence (or not) of some name as a disk file or subdirectory.
  16. One may adapt them for specific purposes, e.g. replacing the textual output
  17. by environment variable definitions. It's simple standard DOS language.
  18.  
  19. In order to test for the existence of subdirectories the DOS command
  20. 'IF EXIST pathname\NUL rem pathname is an existing (sub)directory'
  21. has been used. It appeared that this did not work correctly on
  22. networkdrives or even on local drives with specific network software loaded.
  23. That's too bad, but IBM/Microsoft never guaranteed this tric.
  24.  
  25. That's why CHKEXNET, and following programs, have been written in which the
  26. check is performed by writing a unique temporary file (of length 0) to the
  27. supposed directory and checking the existence of that file. This works in
  28. all instances. However, if the disk is write protected, the test result will
  29. always be negative ('name does not exist').
  30.  
  31. CHKXPATH is an alternative of CHKEXNET in which the textual output has been
  32. replaced by the creation of (0-byte) files in the current directory with
  33. specific names, indicating the existence or not of the tested name as a file or
  34. (non-)empty (sub)directory. If the analyzed drive is write protected or the
  35. directory table is full, the temporary files can not be written and this method
  36. can not be used.
  37.  
  38. Subdirectories will be regarded 'empty' by this test if they do not contain
  39. files, regardless of whether they do contain other subdirectories. This can not
  40. be discriminated (with older DOS versions, can DOS 5?).
  41.  
  42. Take care to set environment variables from a compiled batch file. These
  43. are lost after termination of the program! Or one should use specific
  44. programs to manipulate the base environment, such as the package SETENVJW.
  45.  
  46. For usage help and application just enter the BATch file name from the DOS
  47. prompt without a parameter.
  48.  
  49. ──────────────────────────────────────────────────────────────────────────────
  50. Centrum voor Medische Informatica TNO       <Email>              |  |  |\/|
  51. TNO Center for Medical Informatics | GROENEVELD@CMI.TNO.NL  |  \_/  |  |  |
  52. ( CMI-TNO )    | Y. Groeneveld     | GROENEVELD@CMIHP1.UUCP | Jim Groeneveld
  53. P.O.Box 124    | Wassenaarseweg 56 | GROENEVELD@TNO.NL      | Schoolweg 14
  54. 2300 AC Leiden | 2333 AL Leiden    | ...@HDETNO51.BITNET    | 8071 BC Nunspeet
  55. Nederland.     | (+31|0)71-181810  | Fax (+31|0)71-176382   | 03412-60413
  56.